﻿using System;
using System.Collections;
using System.Collections.Generic;

using System.Linq;
using System.Text;
using System.Drawing;
using System.Collections.ObjectModel;
using System.Threading;

namespace Shoozla.DataModel
{
    public interface ICoverStorage
    {

        void AddCoverToStorage(string uri, string displayName, SearchMethod method);
        void LoadFromStorage(string filename);
        void SaveToStorage(string filename);
        void Reset();
        bool ContainsCover(string uri);
        bool RemoveCover(string uri);
        InternalThumbObject this[string uri] { get; }
        ObservableCollection<Mp3File> GetAllCovers();
        ObservableCollection<CoverThumb> CoverThumbnails { get; }
        CancellationTokenSource CancelTokenSource { get; set; }
        
    }

    
    //used to store the pair displayName <-> image
    public class InternalThumbObject
    {
        public SearchMethod Method { get; set; } //to store the method used to find it
        public String DisplayName { get; set; }
        public Image Cover { get; set; }

        public InternalThumbObject(String displayName, Image cover, SearchMethod method)
        {
            Method = method;
            DisplayName = displayName;
            if (cover != null)
                Cover = cover;
            else
                Cover = Shoozla.DataModel.Properties.Resources.Downloading;

        }
    }
}
